Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 7 - Process Management / Process Management Reference
Functions / Working With System Tasks


OTScheduleSystemTask

Schedules a task for execution at system task time.

C INTERFACE
Boolean OTScheduleSystemTask(long stCookie)
C++ INTERFACES
None. C++ applications use the C interface to this function.

PARAMETERS
stCookie
A reference that identifies the task to be scheduled.
DESCRIPTION
The OTScheduleSystemTask function schedules for execution at system task time the task associated with the stCookie parameter, which is the reference returned by the OTCreateSystemTask function.

You can call this function at any time. If you have not yet destroyed a task, you can use this function to reschedule the same task again once it has executed. If you have canceled a task, you can use this function to schedule it again.

If you makes multiple calls to the OTScheduleSystemTask function before the task is executed, additional tasks are not scheduled; only one instance of each unique task can only be scheduled at a time.

This function returns true if it scheduled the system task successfully, false if not. If the function returns false and the stCookie parameter has a valid value (other than 0), then the task is already scheduled to run. If stCookie is invalid (a value of 0), the function returns false and does nothing.

SPECIAL CONSIDERATIONS
You can call this Open Transport function at interrupt time, but you must precede it by calling the OTEnterInterrupt function and you must follow it by calling the OTLeaveInterrupt function.

SEE ALSO
To create a system task, call the OTCreateSystemTask function (page 7-9).

To destroy a system task created with the OTCreateSystemTask function, call the OTDestroySystemTask function (page 7-13).

To cancel a task scheduled for execution at system task time, call the OTCancelSystemTask function (page 7-12).

Before making this call from within an interrupt, use the OTEnterInterrupt function (page 7-19).

After you have made this call from within an an interrupt, use the OTLeaveInterrupt function (page 7-20).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996